<%@ page import="top.liuzhenyu.study.javawebjdbc.entity.TbComputer" %>
<%@ page import="top.liuzhenyu.study.javawebjdbc.dao.TbComputerDAO" %><%--
  Created by IntelliJ IDEA.
  User: liuzhenyu
  Date: 2024/6/3
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

    <%
        request.setCharacterEncoding("utf-8");

        TbComputer computer = new TbComputer();
        computer.setChangshang(request.getParameter("changshang"));
        computer.setDnjj(request.getParameter("dnjj"));
        computer.setPrice(Integer.parseInt(request.getParameter("price")));
        TbComputerDAO.insert(computer);
    %>

    <script>
        alert("添加成功");
        location.href = "list.jsp";
    </script>


</body>
</html>
